<template>
  <div id="recheckmanage">
    <el-card class="box-card" style="margin:15px">
      <el-form
        ref="basicForm"
        :rules="basicDataRules"
        :inline="true"
        :model="basicData.model"
        class="demo-form-inline"
        size="small"
        label-width="120px"
      >
        <el-row>
          <el-col :span="6">
            <el-form-item label="所属区县:" width="300px" prop="areaId.key">
              <el-select
                size="mini"
                v-model="basicData.model.areaId.key"
                placeholder="选择"
                @change="clickOrgTree"
              >
                <el-option
                  v-for="(item, index) in orgTree"
                  :key="index"
                  :label="item.label"
                  :value="item.id"
                  width="300px"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="所属医院:" prop="hospitalId.key">
              <el-select
                size="mini"
                v-model="basicData.model.hospitalId.key"
                placeholder="选择"
                @change="clickOrgTreeC"
              >
                <el-option
                  v-for="(item, index) in orgTreeC"
                  :key="index"
                  :label="item.label"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="所属部门:" prop="departId.key">
              <el-select size="mini" v-model="basicData.model.departId.key" placeholder="选择">
                <el-option
                  v-for="(item, index) in orgTreeCs"
                  :key="index"
                  :label="item.label"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="6">
            <el-form-item label="母亲姓名:" prop="momName">
              <el-input size="mini" v-model="basicData.model.momName" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="条形码号:" prop="barCode">
              <el-input size="mini" v-model="basicData.model.barCode" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="手机号码:" prop="phone">
              <el-input size="mini" v-model="basicData.model.phone" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="召回状态:" prop="recallStatus.key">
              <el-select size="mini" v-model="basicData.model.recallStatus.key" placeholder="请选择">
                <!-- <el-option
                  v-for="(item, key, index) in dicts.RECALL_STATUS"
                  :key="index"
                  :label="item"
                  :value="key"
                />-->
                <el-option label="已召回" value="Y" />
                <el-option label="未召回" value="N" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="召回类型:" prop="experimentResult.key">
              <el-select
                size="mini"
                v-model="basicData.model.experimentResult.key"
                placeholder="请选择"
              >
                <el-option
                  v-for="(item, key, index) in dicts.EXPERIMENT_RESULT"
                  :key="index"
                  :label="item"
                  :value="key"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="通知状态:" prop="informStatus.key">
              <el-select size="mini" v-model="basicData.model.informStatus.key" placeholder="请选择">
                <!-- <el-option
                  v-for="(item, key, index) in dicts.NOTIFY_STATUS"
                  :key="index"
                  :label="item"
                  :value="key"
                />-->
                <el-option label="已通知" value="Y" />
                <el-option label="未通知" value="N" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="样本属性:" prop="bloodProperty.key">
              <el-select size="mini" v-model="basicData.model.bloodProperty.key" placeholder="请选择">
                <el-option
                  v-for="(item, key, index) in dicts.BLOOD_PROPERTY"
                  :key="index"
                  :label="item"
                  :value="key"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="复检项目:" prop="experimentCode.key">
              <el-select size="mini" v-model="basicData.model.experimentCode.key" placeholder="请选择">
                <el-option
                  v-for="(item, key, index) in dicts.EXPERIMENT_CODE"
                  :key="index"
                  :label="item"
                  :value="key"
                />
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="24" style="padding-left: 2%;">
            <div class="select-input">
              <el-select size="mini" slot="prepend" v-model="timeType" placeholder="实验日期">
                <el-option
                  v-for="(item, key, index) in dicts.TIME"
                  :key="item"
                  :label="item"
                  :value="key"
                />
              </el-select>
              <el-date-picker
                size="mini"
                v-model="timeList"
                type="daterange"
                value-format="yyyy-MM-dd"
                style="width:500px"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
              />

              <el-select
                size="mini"
                slot="prepend"
                v-model="codeType"
                placeholder="实验编号"
                style="margin-left:12.5%"
              >
                <el-option
                  v-for="(item, key, index) in dicts.NUMBER"
                  :key="item"
                  :label="item"
                  :value="key"
                />
              </el-select>
              <el-input size="mini" v-model="codeList.start" placeholder="输入" style="width:300px" />
              <span style="margin:0 10px">至</span>
              <el-input size="mini" v-model="codeList.end" placeholder="输入" style="width:300px" />
            </div>
          </el-col>
        </el-row>
      </el-form>
      <div class="buttom">
        <el-button
          type="primary"
          size="mini"
          style="width:100px"
          icon="el-icon-search"
          @click="onSubmit('query')"
        >查询</el-button>
        <el-button size="mini" @click="onSubmit('reset')">重置</el-button>
      </div>
    </el-card>
    <el-card class="box-card" style="margin:5px 15px;">
      <div style="margin-bottom:10px">
        <el-button size="mini" type="primary" icon="el-icon-s-unfold" @click="recheck">复检</el-button>
        <el-button size="mini" type="primary" icon="el-icon-message" @click="clickInform">通知</el-button>
        <el-button size="mini" @click="clickStatus">状态</el-button>
        <el-button size="mini">导出</el-button>
        <el-button size="mini">单项导出</el-button>
      </div>
      <el-table
        v-loading="loading"
        :data="tableData"
        style="width: 100%;padding:5px;"
        :header-cell-style="{
          background: '#333333',
          color: '#ffffff',
          textAlign: 'center'
        }"
        @selection-change="onSelectChange"
      >
        <el-table-column align="center" type="selection" width="55" />
        <el-table-column align="center" prop="expNum" width="120" label="实验编码" />
        <el-table-column align="center" prop="barCode" width="120" label="条形码号" />
        <el-table-column align="center" prop="newBarCode" label="新条码" />
        <el-table-column align="center" prop="momName" label="母亲姓名" />
        <el-table-column align="center" prop="phone" width="120" label="手机号码" />
        <el-table-column align="center" prop="weight" label="婴儿体重" />
        <el-table-column align="center" prop="babySex.data" label="性别" />
        <el-table-column align="center" prop="hospitalName" label="所属医院" />
        <el-table-column align="center" prop="birthTime" width="125" label="出生日期">
          <template slot-scope="scope">
            <span>{{ scope.row.birthTime ? scope.row.birthTime.substr(0, 10) : '' }}</span>
          </template>
        </el-table-column>
        <el-table-column align="center" prop="informStatus.data" width="125" label="通知状态" />
        <el-table-column align="center" prop="experimentResult.data" label="召回类型" />
        <el-table-column align="center" prop="recallStatus.data" label="召回状态" />
        <el-table-column align="center" label="报告值">
          <template slot-scope="scope">
            <span style="color: #1890ff;cursor: pointer;" @click="clickLook(scope.row)">点击查看</span>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
        :current-page="basicData.current"
        :page-size="basicData.size"
        :total="total"
        layout="slot,total, sizes, prev, pager, next, jumper"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      >
        <span
          v-if="selectList.length > 0"
          style="font-weight: 400;color:#606266"
        >已选中{{ selectList.length }}条，</span>
      </el-pagination>
    </el-card>

    <!-- 复检弹窗 -->
    <el-dialog :visible.sync="recheckShow" width="85%" center custom-class="print-dialog">
      <span
        slot="title"
        class="dialog-title"
        style="font-size: 18px;font-weight: 400;color: #FFFFFF;"
      >复检</span>
      <el-form
        ref="recheckForm"
        :rules="recheckDataRules"
        :inline="true"
        :model="recheckData"
        class="recheckShow-form"
        size="small"
        label-width="120px"
      >
        <el-row>
          <el-col :span="6">
            <el-form-item label="所属区县:" width="300px" prop="areaId.key">
              <el-select
                size="mini"
                v-model="recheckData.areaId.key"
                placeholder="选择"
                @change="clickOrgTree"
              >
                <el-option
                  v-for="(item, index) in orgTree"
                  :key="index"
                  :label="item.label"
                  :value="item.id"
                  width="300px"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="所属医院:" prop="hospitalId.key">
              <el-select
                size="mini"
                v-model="recheckData.hospitalId.key"
                placeholder="选择"
                @change="clickOrgTreeC"
              >
                <el-option
                  v-for="(item, index) in orgTreeC"
                  :key="index"
                  :label="item.label"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="所属部门:" prop="departId.key">
              <el-select size="mini" v-model="recheckData.departId.key" placeholder="选择">
                <el-option
                  v-for="(item, index) in orgTreeCs"
                  :key="index"
                  :label="item.label"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="采血编号:" prop="bloodNum">
              <el-input size="mini" v-model="recheckData.bloodNum" placeholder="输入" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <el-form-item label="条形码号:" prop="barCode">
              <el-input size="mini" v-model="recheckData.barCode" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="母亲姓名:" prop="momName">
              <el-input size="mini" v-model="recheckData.momName" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="采血日期:" prop="bloodTime">
              <el-date-picker
                size="mini"
                :format="bloodTimeFormat"
                @focus="recheckData.bloodTime = ''"
                v-model="recheckData.bloodTime"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择日期"
              />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="性别:" prop="babySex.key">
              <el-radio-group v-model="recheckData.babySex.key">
                <el-radio
                  v-for="(item, key, index) in dicts.BABY_SEX"
                  :key="item"
                  :label="key"
                >{{ item }}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <el-form-item label="出生日期:" prop="birthTime">
              <el-date-picker
                size="mini"
                :format="birthTimeFormat"
                @focus="recheckData.birthTime = ''"
                v-model="recheckData.birthTime"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择日期"
              />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="手机号码:" prop="phone">
              <el-input size="mini" v-model="recheckData.phone" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="婴儿体重:" prop="weight">
              <el-input size="mini" v-model="recheckData.weight" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="孕周:" prop="weeks">
              <el-input size="mini" v-model="recheckData.weeks" placeholder="输入" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <el-form-item label="孕天:" prop="days">
              <el-input size="mini" v-model="recheckData.days" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="母亲身份证:" prop="momCard">
              <el-input size="mini" v-model="recheckData.momCard" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="户籍类型:" prop="accountType.key">
              <el-radio-group v-model="recheckData.accountType.key">
                <el-radio
                  v-for="(item, key, index) in dicts.BABY_SEX"
                  :key="item"
                  :label="key"
                >{{ item }}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="实验编号:" prop="expNum">
              <el-input size="mini" v-model="recheckData.expNum" placeholder="输入" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-col :span="6">
              <el-form-item label="住址:" prop="address">
                <el-input size="mini" v-model="recheckData.address" placeholder="输入" />
              </el-form-item>
            </el-col>
            <el-col :span="18">
              <!-- <el-form-item label="实验项目-重采:" prop="experimentProject">
                <el-checkbox-group v-model="recheckData.experimentProject">
                  <el-checkbox
                    name="type"
                    v-for="(item, key, index) in dicts.EXPERIMENT_CODE"
                    :key="index"
                    :label="item"
                  >{{ item }}</el-checkbox>
                </el-checkbox-group>
              </el-form-item>
              -->
              <el-form-item label="实验项目-重采:" prop="experimentKeywords.key">
                <el-radio-group v-model="recheckData.experimentKeywords.key">
                  <el-radio
                    v-for="(item, key, index) in dicts.EXPERIMENT_CODE"
                    :key="index"
                    :label="key"
                  >{{ item }}</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <el-form-item label="费用类型:" prop="costType.key">
              <el-radio-group v-model="recheckData.costType.key">
                <el-radio
                  v-for="(item, key, index) in dicts.COST_TYPE"
                  :key="item"
                  :label="key"
                >{{ item }}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="代金劵号:" prop="freeNum">
              <el-input size="mini" v-model="recheckData.freeNum" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="父亲身份证:" prop="dadCard">
              <el-input size="mini" v-model="recheckData.dadCard" placeholder="输入" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button size="mini" type="primary" style="padding: 6px 19px;" @click="recheckSeave()">保存</el-button>
      </span>
    </el-dialog>

    <!-- 点击查看 -->
    <el-dialog width="65%" title="实验数据" :visible.sync="seeShow" append-to-body>
      <!-- 表格 -->
      <el-row style="line-height: 1.5;border:1px solid">
        <el-col
          :span="5"
          style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;border-right:1px solid"
        >筛查项目</el-col>
        <el-col
          :span="3"
          style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;border-right:1px solid"
        >检测指标</el-col>
        <el-col
          :span="3"
          style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;border-right:1px solid"
        >检测值</el-col>
        <el-col
          :span="5"
          style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;border-right:1px solid"
        >正常参考值</el-col>
        <el-col
          :span="8"
          style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;"
        >筛查结果</el-col>
        <!-- hint -->
      </el-row>
      <!-- 表格内容 -->
      <el-row
        style="line-height: 1.5;border-bottom:1px solid;border-left:1px solid;border-right:1px solid;"
      >
        <div v-for="(item, key, index) in seeData" :key="index">
          <el-col
            :span="5"
            :style="item.experimentValueResult != 'normal' ? 'background-color:#baccef;':''"
            style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;border-right:1px solid"
          >{{ item.indicatorCodeName }}&nbsp</el-col>
          <el-col
            :span="3"
            :style="item.experimentValueResult != 'normal' ? 'background-color:#baccef;':''"
            style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;border-right:1px solid"
          >{{ item.indicatorCode }}&nbsp</el-col>
          <el-col
            :span="3"
            :style="item.experimentValueResult != 'normal' ? 'background-color:#baccef;':''"
            style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;border-right:1px solid"
          >{{ item.experimentValue }}{{ item.units }}&nbsp</el-col>
          <el-col
            :span="5"
            :style="item.experimentValueResult != 'normal' ? 'background-color:#baccef;':''"
            style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;border-right:1px solid"
          >{{ item.referenceValue }}&nbsp</el-col>
          <el-col
            :span="8"
            :style="item.experimentValueResult != 'normal' ? 'background-color:#baccef;':''"
            style="display:flex;justify-content: center;color:#000000f2;font-size: 15px;border-right:1px solid"
          >{{ item.hint }}&nbsp</el-col>
        </div>
      </el-row>
    </el-dialog>

    <!-- 通知弹窗 -->
    <el-dialog :visible.sync="informShow" width="85%" center title="通知" custom-class="print-dialog">
      <el-form
        ref="informForm"
        :inline="true"
        :model="informData"
        class="demo-form-inline"
        size="small"
        label-width="95px"
      >
        <el-row>
          <el-col :span="8">
            <el-form-item label="所属医院:" width="300px">
              <span>
                {{
                informData.sampleBlood
                ? informData.sampleBlood.hospitalName
                : ""
                }}
              </span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="母亲姓名:" width="300px">
              <span>
                {{
                informData.sampleBlood ? informData.sampleBlood.momName : ""
                }}
              </span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="手机号码:" width="300px">
              <span>
                {{
                informData.sampleBlood ? informData.sampleBlood.phone : ""
                }}
              </span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="出生日期:" width="300px">
              <span>
                {{
                informData.sampleBlood ? informData.sampleBlood.birthTime : ""
                }}
              </span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="住院号:" width="300px">
              <span></span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="床位号:" width="300px">
              <span></span>
            </el-form-item>
          </el-col>
        </el-row>

        <el-table
          :data="informData.experimentSamples"
          style="width: 100%;padding:5px;"
          :header-cell-style="{
            background: '#333333',
            color: '#ffffff',
            textAlign: 'center'
          }"
        >
          <el-table-column align="center" type="index" width="55" />
          <el-table-column align="center" prop="barCode" label="条形码号" width="150" />
          <el-table-column align="center" prop="expNum" label="实验编号" width="150" />
          <el-table-column align="center" prop="experimentCode.data" label="实验项目" />
          <el-table-column align="center" prop="flowStatus.data" label="流程状态" />
          <el-table-column align="center" prop="experimentResultTime" label="实验日期" width="150">
            <template slot-scope="scope">
              <span>
                {{
                scope.row.experimentResultTime
                ? scope.row.experimentResultTime.substr(0, 10)
                : ""
                }}
              </span>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="experimentValue" label="值" />
          <el-table-column align="center" prop="experimentResult.data" label="结论" />
          <el-table-column align="center" prop="doctorAdvice" label="医嘱" show-overflow-tooltip />
        </el-table>

        <el-form-item label="待通知项目:" style="margin-bottom:5px">
          <el-checkbox-group v-model="informData.experimentProject">
            <el-checkbox
              name="type"
              v-for="(item, key, index) in informData.experimentProject"
              :key="index"
              :label="item"
            >{{ item.data }}</el-checkbox>
          </el-checkbox-group>
        </el-form-item>
        <el-row>
          <el-col :span="5">
            <el-form-item label="通知人:" label-width="80px">
              <el-input
                size="mini"
                disabled
                v-model="informData.sampleBlood.informMan"
                placeholder="输入"
              />
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item label="通知日期:">
              <el-date-picker
                size="mini"
                :format="informTimeFormat"
                @focus="informData.sampleBlood.informTime = ''"
                v-model="informData.sampleBlood.informTime"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择日期"
              />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="通知方式:">
              <el-radio-group v-model="informData.sampleBlood.informWay.key">
                <el-radio
                  v-for="(item, key, index) in dicts.INFORM_WAY"
                  :key="index"
                  :label="key"
                >{{ item }}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="6" style="margin-bottom:5px">
            <el-form-item label="被告知人:" label-width="80px">
              <el-radio-group v-model="informData.sampleBlood.informGet.key">
                <el-radio
                  v-for="(item, key, index) in dicts.INFORM_GET"
                  :key="index"
                  :label="key"
                >{{ item }}</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>

          <el-col :span="24" style="margin-bottom:5px">
            <el-form-item label="通知内容:" class="inform-print" label-width="80px">
              <el-input
                size="mini"
                type="textarea"
                style="100%"
                v-model="informData.sampleBlood.informContent"
                placeholder="输入"
              />
            </el-form-item>
          </el-col>
          <el-col :span="24" style="margin-bottom:5px">
            <el-form-item label="通知备注:" class="inform-print" label-width="80px">
              <el-input
                size="mini"
                style="100%"
                v-model="informData.sampleBlood.informDesc"
                placeholder="输入"
              />
            </el-form-item>
          </el-col>
          <el-col :span="24" style="margin-bottom:5px">
            <el-form-item label="归档:" label-width="80px">
              <el-select
                size="mini"
                v-model="informData.sampleBlood.fileStatus.key"
                placeholder="归档"
              >
                <el-option
                  v-for="(item, key, index) in dicts.FILE_STATUS"
                  :key="index"
                  :label="item"
                  :value="key"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-table
          :data="informData.messageList"
          style="width: 100%;padding:5px;"
          :header-cell-style="{
            background: '#333333',
            color: '#ffffff',
            textAlign: 'center'
          }"
        >
          <el-table-column align="center" type="index" width="55" />
          <el-table-column align="center" prop="informMan" label="通知人" />
          <el-table-column align="center" prop="informWay.data" label="通知方式" />
          <el-table-column align="center" prop="informTime" label="通知日期" width="100">
            <template slot-scope="scope">
              <span>
                {{
                scope.row.informTime ? scope.row.informTime.substr(0, 10) : ""
                }}
              </span>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="informGet.data" label="被告知人" />
          <el-table-column align="center" prop="informContent" label="内容" />
          <el-table-column align="center" prop="informDesc" label="备注" />
          <el-table-column align="center" prop="createTime" label="创建时间">
            <template slot-scope="scope">
              <span>
                {{
                scope.row.createTime ? scope.row.createTime.substr(0, 10) : ""
                }}
              </span>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="experimentValue" label="值" />
          <el-table-column align="center" prop="experimentResult.data" label="结论" />
          <el-table-column align="center" prop="doctorAdvice" label="医嘱" show-overflow-tooltip />
        </el-table>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button
          size="small"
          type="primary"
          style="padding: 6px 19px;"
          @click="onSubmit('infoSave')"
        >保存</el-button>
      </span>
    </el-dialog>

    <!-- 状态弹窗 -->
    <el-dialog :visible.sync="statusShow" width="85%" center title="状态" custom-class="print-dialog">
      <el-form
        ref="informForm"
        :inline="true"
        :model="statusData"
        class="demo-form-inline"
        size="small"
        label-width="100px"
      >
        <el-row>
          <el-col :span="8">
            <el-form-item label="母亲姓名:" width="300px">
              <span>{{ statusData.sampleBlood.momName ? statusData.sampleBlood.momName : "" }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="出生日期:" width="300px">
              <span>
                {{
                statusData.sampleBlood.birthTime ? statusData.sampleBlood.birthTime : ""
                }}
              </span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="性别:" width="300px">
              <span>
                {{
                statusData.sampleBlood.babySex ? statusData.sampleBlood.babySex.data : ""
                }}
              </span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="手机号码:" width="300px">
              <span>{{ statusData.sampleBlood.phone ? statusData.sampleBlood.phone : "" }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="电话号码:" width="300px">
              <span></span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="住院号:" width="300px">
              <span></span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="床位号:" width="300px">
              <span></span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="分娩方式:" width="300px">
              <span></span>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="联系地址:" width="300px">
              <span>{{ statusData.sampleBlood.address ? statusData.sampleBlood.address : "" }}</span>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row style="padding-left: 45px;">
          <el-col :span="3">
            <el-form-item>
              <el-checkbox v-model="statuslist.recallStatus" true-label="Y" label="已召回"></el-checkbox>
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="实验项目:" style="display: flex;align-items: center;">
              <span style="display: flex;align-items: center;">{{ statuslist.experimentCode.data }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="3" style="display: flex;align-items: center;">
            <el-form-item label="实验值:">
              <span
                style="color: #1890ff;cursor: pointer;display: flex;align-items: center;"
                @click="clickLook(selectList[0])"
              >点击查看</span>
            </el-form-item>
          </el-col>
          <el-col :span="14">
            <el-col :span="8">
              <el-form-item label="诊断状态:">
                <el-input
                  size="mini"
                  style="100%"
                  v-model="statuslist.diagnoseStatus.key"
                  placeholder="输入"
                />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="疾病名称:">
                <el-input
                  size="mini"
                  style="100%"
                  v-model="statuslist.illnessName"
                  placeholder="输入"
                />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="确诊日期:">
                <el-date-picker
                  size="mini"
                  v-model="statuslist.confirmedTime"
                  type="date"
                  value-format="yyyy-MM-dd"
                  placeholder="选择日期"
                />
              </el-form-item>
            </el-col>
          </el-col>
        </el-row>
        <el-col :span="24" style="margin-bottom:5px">
          <el-col :span="12">
            <el-form-item label="归档:" label-width="80px">
              <el-select size="mini" v-model="statuslist.fileStatus.key" placeholder="归档">
                <el-option
                  v-for="(item, key, index) in dicts.FILE_STATUS"
                  :key="index"
                  :label="item"
                  :value="key"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12" v-if="statuslist.fileStatus.key =='archived'">
            <el-form-item label="归档原因:" label-width="80px">
              <el-input
                size="mini"
                style="100%"
                v-model="statuslist.fileReason.key"
                placeholder="输入"
              />
            </el-form-item>
          </el-col>
        </el-col>
        <el-col :span="24" style="margin-bottom:5px">
          <el-form-item label="备注:" class="inform-print" label-width="80px">
            <el-input size="mini" style="100%" v-model="statuslist.recallDesc" placeholder="输入" />
          </el-form-item>
        </el-col>
        <el-table
          :data="statusData.list"
          style="width: 100%;padding:5px;"
          :header-cell-style="{
          background: '#333333',
          color: '#ffffff',
          textAlign: 'center'
        }"
        >
          <el-table-column align="center" prop="experimentCode.data" width="120" label="实验项目" />
          <el-table-column align="center" label="实验值">
            <template slot-scope="scope">
              <span style="color: #1890ff;cursor: pointer;" @click="clickLook(scope.row)">点击查看</span>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="diagnoseStatus.data" width="120" label="诊断记录" />
          <el-table-column align="center" prop="illnessName" label="疾病名称" />
          <el-table-column align="center" prop="recallMan" label="召回医生" />
          <el-table-column align="center" prop="confirmedTime" label="确诊日期">
            <template slot-scope="scope">
              <span>{{ scope.row.confirmedTime ? scope.row.confirmedTime.substr(0, 10) : '' }}</span>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="createTime" label="创建日期">
            <template slot-scope="scope">
              <span>{{ scope.row.createTime ? scope.row.createTime.substr(0, 10) : '' }}</span>
            </template>
          </el-table-column>
        </el-table>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button
          size="small"
          type="primary"
          style="padding: 6px 19px;"
          @click="onSubmit('statusSave')"
        >保存</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { initDicts } from "@/utils/commons";
import orgApi from "@/api/Org.js";
import RecallManageApi from "@/api/RecallManage.js";

export default {
  data() {
    return {
      // 出生日期输入格式
      birthTimeFormat: "MMdd",
      // 采血日期输入格式
      bloodTimeFormat: "MMdd",
      // 通知日期
      informTimeFormat: "MMdd",
      // 是否展示更多信息
      morderShow: true,
      // 转菊花
      loading: false,
      // 复检显示
      recheckShow: false,
      // 查看弹窗
      seeShow: false,
      // 通知弹窗
      informShow: false,
      // 状态弹窗
      statusShow: false,
      // 查看数据
      seeData: {},
      // 表格数据
      tableData: [],
      // 选中数据
      selectList: [],
      // 基本数据
      basicData: {
        current: 1,
        map: {},
        model: {
          areaId: {
            key: ""
          },
          barCode: "",
          barCodes: {
            end: "",
            start: ""
          },
          birthTime: {
            end: "",
            start: ""
          },
          bloodNum: {
            end: "",
            start: ""
          },
          bloodProperty: {
            data: "",
            key: ""
          },
          bloodTime: {
            end: "",
            start: ""
          },
          createTime: {
            end: "",
            start: ""
          },
          departId: {
            key: ""
          },
          expNum: {
            end: "",
            start: ""
          },
          experimentCode: {
            data: "",
            key: ""
          },
          experimentResult: {
            data: "",
            key: ""
          },
          experimentTime: {
            end: "",
            start: ""
          },
          freeNum: {
            end: "",
            start: ""
          },
          hospitalId: {
            key: ""
          },
          informStatus: {
            data: "",
            key: ""
          },
          momName: "",
          phone: "",
          recallStatus: {
            data: "",
            key: ""
          },
          reportTime: {
            end: "",
            start: ""
          },
          sendStatus: {
            data: "",
            key: ""
          }
        },
        order: "descending",
        size: 10,
        sort: "id"
      },
      // 校验
      basicDataRules: {
        countyAndCitiesId: [
          { required: false, message: "请选择所属区县", trigger: "change" }
        ],
        hospitalId: [
          { required: false, message: "请选择所属医院", trigger: "change" }
        ],
        deptId: [
          { required: false, message: "请选择所属部门", trigger: "change" }
        ],
        motherName: [
          { required: false, message: "请输入母亲姓名", trigger: "change" }
        ],
        tel: [
          { required: false, message: "请输入手机号码", trigger: "change" }
        ],
        weight: [{ required: false, message: "请输入体重", trigger: "change" }],
        week: [{ required: false, message: "请输入孕周", trigger: "change" }],
        day: [{ required: false, message: "请输入孕天", trigger: "change" }],
        sex: [{ required: false, message: "请选择性别", trigger: "change" }],
        samplingNumber: [
          { required: false, message: "请输入采血编号", trigger: "change" }
        ],
        barCode: [
          { required: false, message: "请输入条形码号", trigger: "change" }
        ]
      },
      // 字典
      dicts: {
        FILE_STATUS: {}, //归档状态
        RECALL_STATUS: {}, //召回状态
        DISQUALIFICATION_REASON: {}, //不合格原因
        NUMBER: {}, //编码
        BABY_SEX: {}, //性别
        COST_TYPE: {}, //费用
        EXPERIMENT_CODE: {}, //项目
        ACCOUNT_TYPE: {}, //户籍类型
        INFORM_WAY: {}, //通知方式
        INFORM_GET: {}, //被告知人
        EXPERIMENT_RESULT: {}, //实验结论
        NOTIFY_STATUS: {}, //通知状态
        BLOOD_PROPERTY: {}, //样本属性
        TIME: {}, //日期
        NUMBER: {} //编码
      },
      // 市县
      orgTree: [],
      // 医院
      orgTreeC: [],
      // 部门
      orgTreeCs: [],
      total: 0,
      //时间类型
      timeType: "",
      //时间列表
      timeList: [],
      //编码类型
      codeType: "",
      // 编码
      codeList: {
        start: "",
        end: ""
      },
      // 复检
      recheckDataRules: {
        "areaId.key": [{ required: true, message: "必填", trigger: "change" }],
        "hospitalId.key": [
          { required: true, message: "必填", trigger: "change" }
        ],
        "departId.key": [
          { required: true, message: "必填", trigger: "change" }
        ],
        momName: [{ required: true, message: "必填", trigger: "change" }],
        phone: [
          { required: true, message: "必填", trigger: "change" },
          {
            required: true,
            pattern: /^1[3456789]\d{9}$/,
            message: "请输入正确格式的手机号",
            trigger: "blur"
          }
        ],
        weight: [
          { required: true, message: "必填", trigger: "change" },
          {
            pattern: /^[0-9]*$/,
            message: "请填写正确格式的数字",
            trigger: "change"
          },
          {
            required: true,
            validator: this.$weightNum,
            trigger: "blur",
            message: "请输入600—8000的数字"
          }
        ],
        weeks: [
          { required: true, message: "必填", trigger: "change" },
          {
            pattern: /^[0-9]*$/,
            message: "请填写正确格式的数字",
            trigger: "change"
          },
          {
            required: true,
            validator: this.$weeksNum,
            trigger: "blur",
            message: "请输入20—50的数字"
          }
        ],
        // days: [
        //   { required: true, message: "必填", trigger: "change" },
        //   {
        //     pattern: /^[0-9]*$/,
        //     message: "请填写正确格式的数字",
        //     trigger: "change"
        //   },
        //   {
        //     required: true,
        //     validator: this.$daysNum,
        //     trigger: "blur",
        //     message: "请输入0—6的数字"
        //   }
        // ],
        birthTime: [{ required: true, message: "  ", trigger: "change" }],
        bloodTime: [{ required: true, message: "  ", trigger: "change" }],
        babySex: [{ required: true, message: "  ", trigger: "change" }],
        barCode: [
          {
            required: true,
            message: "必填",
            trigger: "change"
          },
          {
            pattern: /^[0-9]*$/,
            message: "请填写正确格式的数字",
            trigger: "change"
          },
          {
            required: true,
            validator: this.$barCodeNum,
            trigger: "blur",
            message: "请输入14000000000—20999999999的数字"
          }
        ],
        costType: [{ required: true, message: "  ", trigger: "change" }],
        dadCard: [
          {
            pattern: /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/,
            message: "身份证号格式错误",
            trigger: "change"
          }
        ],
        momCard: [
          {
            pattern: /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/,
            message: "身份证号格式错误",
            trigger: "change"
          }
        ],
        freeNum: [
          {
            pattern: /^[0-9]*$/,
            message: "请填写正确格式的数字",
            trigger: "change"
          },
          {
            validator: this.$freeNum,
            message: "请输入200110001—200145000的数字",
            trigger: "change"
          }
        ]
      },
      recheckData: {
        accountType: {
          data: "",
          key: ""
        },
        address: "",
        areaId: {
          key: ""
        },
        babySex: {
          data: "",
          key: ""
        },
        barCode: "",
        birthTime: "",
        bloodNum: "",
        bloodProperty: {
          data: "",
          key: ""
        },
        bloodReview: {
          data: "",
          key: ""
        },
        bloodStatus: {
          data: "",
          key: ""
        },
        bloodTime: "",
        costType: {
          data: "",
          key: ""
        },
        createTime: "",
        createUpdate: 0,
        createUser: 0,
        dadCard: "",
        dadCensus: {
          data: "",
          key: ""
        },
        dadCensusAddress: "",
        days: 0,
        departId: {
          key: ""
        },
        disqualificationReason: "",
        expNum: "",
        experimentKeywords: {
          data: "",
          key: ""
        },
        experimentProject: [],
        experimentResult: {
          data: "",
          key: ""
        },
        fileStatus: {
          data: "",
          key: ""
        },
        flowStatus: {
          data: "",
          key: ""
        },
        freeNum: "",
        getexamineDoctor: "",
        hospitalId: {
          key: ""
        },
        hospitalName: "",
        id: 0,
        isDel: 0,
        momCard: "",
        momCensus: {
          data: "",
          key: ""
        },
        momName: "",
        nation: "",
        newBarcode: "",
        payWay: {
          data: "",
          key: ""
        },
        phone: "",
        price: 0,
        receiveTime: "",
        remark: "",
        sampleQuality: {
          data: "",
          key: ""
        },
        samplingPeople: "",
        sourceWay: {
          data: "",
          key: ""
        },
        updateTime: "",
        updateUser: 0,
        weeks: 0,
        weight: 0
      },
      // 通知数据
      informData: {
        experimentProject: [],
        experimentSamples: [],
        messageList: [],
        sampleBlood: {
          fileStatus: {
            key: "undocumented"
          },
          informGet: {
            key: "mom"
          },
          informWay: {
            key: "phone"
          }
        }
      },
      // 状态数据
      statusData: {
        experimentCode: {},
        list: [],
        sampleBlood: {
          fileStatus: {
            key: "undocumented"
          }
        }
      },
      // 状态修改的列表
      statuslist: {
        experimentCode: {
          data: "",
          key: ""
        },
        fileReason: {
          data: "",
          key: ""
        },
        fileStatus: {
          data: "",
          key: ""
        },
        recallStatus: "Y",
        diagnoseStatus: {
          data: "",
          key: ""
        }
      },
      recallStatus: [],
      experimentValue: [],
      experimentResult: []
    };
  },
  mounted() {
    initDicts(
      [
        "FILE_STATUS",
        "RECALL_STATUS",
        "DISQUALIFICATION_REASON",
        "NUMBER",
        "BABY_SEX",
        "COST_TYPE",
        "EXPERIMENT_CODE",
        "ACCOUNT_TYPE",
        "INFORM_WAY",
        "INFORM_GET",
        "EXPERIMENT_RESULT",
        "NOTIFY_STATUS",
        "TIME",
        "BLOOD_PROPERTY",
        "NUMBER"
      ],
      this.dicts
    );
    // 获取基础查询
    this.initOrgTree();
    // 获取表格数据
    this.getList(this.basicData);
  },
  methods: {
    // 出生日期输入
    changeBirthTime(v, type) {
      this.recheckData.birthTime = v;
      if (this.recheckData.birthTime) {
        this.birthTimeFormat = "yyyy-MM-dd";
      } else {
        this.birthTimeFormat = "MMdd";
      }
    },
    // 采血日期输入
    changeBloodTime(v, type) {
      this.recheckData.bloodTime = v;
      if (this.recheckData.bloodTime) {
        this.bloodTimeFormat = "yyyy-MM-dd";
      } else {
        this.bloodTimeFormat = "MMdd";
      }
    },
    // 通知日期输入
    changeInformTime(v, type) {
      this.informData.sampleBlood.informTime = v;
      if (this.informData.sampleBlood.informTime) {
        this.informTimeFormat = "yyyy-MM-dd";
      } else {
        this.informTimeFormat = "MMdd";
      }
    },
    // 点击状态
    clickStatus() {
      if (this.selectList.length == 0) {
        this.$message.error("请选择一条数据!");
        return;
      } else if (this.selectList.length > 1) {
        this.$message.error("请选择单条数据!");
        return;
      }
      RecallManageApi.recheckManage
        .queryRecall(this.selectList[0])
        .then(res => {
          if (res.status == 200) {
            this.statusData = res.data.data;
            this.statuslist = {
              confirmedTime:
                new Date().getFullYear().toString() +
                "-" +
                ((new Date().getMonth() + 1).toString() < 10
                  ? "0" + (new Date().getMonth() + 1).toString()
                  : (new Date().getMonth() + 1).toString()) +
                "-" +
                (new Date().getDate().toString() < 10
                  ? "0" + new Date().getDate().toString()
                  : new Date().getDate().toString()),
              diagnoseStatus: {
                data: "",
                key: ""
              },
              experimentCode: res.data.data.experimentCode,
              fileReason: {
                data: "",
                key: ""
              },
              fileStatus: {
                data: "",
                key: ""
              },
              illnessName: "",
              recallDesc: "",
              recallMan: this.$store.state.account.user.name,
              recallStatus: "Y",
              recallTime:
                new Date().getFullYear().toString() +
                "-" +
                ((new Date().getMonth() + 1).toString() < 10
                  ? "0" + (new Date().getMonth() + 1).toString()
                  : (new Date().getMonth() + 1).toString()) +
                "-" +
                (new Date().getDate().toString() < 10
                  ? "0" + new Date().getDate().toString()
                  : new Date().getDate().toString()),
              sampleId: res.data.data.sampleBlood.id
            };

            this.statusShow = true;
          } else {
            this.$message.error(res.statusText);
          }
        });
    },
    // 点击通知
    clickInform() {
      if (this.selectList.length == 0) {
        this.$message.error("请选择一条数据!");
        return;
      } else if (this.selectList.length > 1) {
        this.$message.error("请选择单条数据!");
        return;
      }
      RecallManageApi.recheckManage
        .informList({ sampleId: this.selectList[0].sampleId })
        .then(res => {
          if (res.status == 200) {
            this.informData = res.data.data;
            this.informData.sampleBlood = {
              informTime:
                new Date().getFullYear().toString() +
                "-" +
                ((new Date().getMonth() + 1).toString() < 10
                  ? "0" + (new Date().getMonth() + 1).toString()
                  : (new Date().getMonth() + 1).toString()) +
                "-" +
                (new Date().getDate().toString() < 10
                  ? "0" + new Date().getDate().toString()
                  : new Date().getDate().toString()),
              fileStatus: {
                key: "undocumented"
              },
              informGet: {
                key: "mom"
              },
              informWay: {
                key: "phone"
              },
              ...res.data.data.sampleBlood,
              informMan: this.$store.state.account.user.name
            };
            this.informShow = true;
          } else {
            this.$message.error(res.statusText);
          }
        });
    },
    // 点击查看
    clickLook(v) {
      RecallManageApi.recheckManage.queryReport(v).then(res => {
        if (res.status == 200) {
          let sortData = [];
          for (let key in res.data.data.experimentValue) {
            sortData.push(res.data.data.experimentValue[key]);
          }
          this.seeData = this.$keysrt(sortData, "sortValue");
          this.seeShow = true;
        } else {
          this.$message.error(res.statusText);
        }
      });
    },
    // 点击复检
    recheck() {
      if (this.selectList.length == 0) {
        this.$message.error("请选择一条数据！");
        return;
      }
      if (this.selectList.length > 1) {
        this.$message.error("请选择单条数据！");
        return;
      }

      RecallManageApi.recheckManage.ReviewList(this.selectList[0]).then(res => {
        if (res.data.data != null) {
          if (res.data.data.experimentKeywords == null) {
            res.data.data.experimentKeywords = {
              data: "",
              key: ""
            };
          }
          this.recheckData = res.data.data;
          this.orgTree.filter(res => {
            if (res.id == this.recheckData.areaId.key) {
              this.orgTreeC = res.children;
            }
          });
          this.orgTreeC.filter(res => {
            if (res.id == this.recheckData.hospitalId.key) {
              this.orgTreeCs = res.children;
            }
          });
          this.recheckShow = true;
        }
      });
    },
    // 复检保存
    recheckSeave() {
      this.$refs.recheckForm.validate(valid => {
        if (valid) {
          RecallManageApi.recheckManage
            .SaveSample(this.recheckData)
            .then(res => {
              if (res.status == 200) {
                this.recheckShow = false;
                this.getList(this.basicData);
              } else {
                this.$message.error(res.statusText);
              }
            });
        } else {
          return false;
        }
      });
    },
    // 获取列表
    getList(data) {
      this.loading = true;
      RecallManageApi.recheckManage
        .page(data)
        .then(res => {
          if (res.status == 200) {
            this.tableData = res.data.data.records;
            this.total = res.data.data.total;
          }
        })
        .finally(() => (this.loading = false));
    },
    // 选择数据
    onSelectChange(data) {
      this.selectList = data;
    },
    // 基础信息按钮点击事件
    onSubmit(type) {
      if (type == "query") {
        switch (this.timeType) {
          // 实验日期
          case "experimenttime":
          case "":
            this.basicData.model.experimentTime = {
              start: this.timeList[0],
              end: this.timeList[1]
            };
            this.basicData.model.birthTime = {
              start: "",
              end: ""
            };
            this.basicData.model.bloodTime = {
              start: "",
              end: ""
            };
            this.basicData.model.createTime = {
              start: "",
              end: ""
            };
            this.basicData.model.reportTime = {
              start: "",
              end: ""
            };
            break;
          // 采血日期
          case "bloodtime":
            this.basicData.model.bloodTime = {
              start: this.timeList[0],
              end: this.timeList[1]
            };
            this.basicData.model.birthTime = {
              start: "",
              end: ""
            };
            this.basicData.model.createTime = {
              start: "",
              end: ""
            };
            this.basicData.model.experimentTime = {
              start: "",
              end: ""
            };
            this.basicData.model.reportTime = {
              start: "",
              end: ""
            };
            break;
          // 登记日期
          case "createtime":
            this.basicData.model.createTime = {
              start: this.timeList[0],
              end: this.timeList[1]
            };
            this.basicData.model.birthTime = {
              start: "",
              end: ""
            };
            this.basicData.model.bloodTime = {
              start: "",
              end: ""
            };
            this.basicData.model.experimentTime = {
              start: "",
              end: ""
            };
            this.basicData.model.reportTime = {
              start: "",
              end: ""
            };
            break;
          // 出生日期
          case "birthtime":
            this.basicData.model.birthTime = {
              start: this.timeList[0],
              end: this.timeList[1]
            };
            this.basicData.model.bloodTime = {
              start: "",
              end: ""
            };
            this.basicData.model.createTime = {
              start: "",
              end: ""
            };
            this.basicData.model.experimentTime = {
              start: "",
              end: ""
            };
            this.basicData.model.reportTime = {
              start: "",
              end: ""
            };
            break;
          // 报告日期
          case "reporttime":
            this.basicData.model.reportTime = {
              start: this.timeList[0],
              end: this.timeList[1]
            };
            this.basicData.model.birthTime = {
              start: "",
              end: ""
            };
            this.basicData.model.bloodTime = {
              start: "",
              end: ""
            };
            this.basicData.model.createTime = {
              start: "",
              end: ""
            };
            this.basicData.model.experimentTime = {
              start: "",
              end: ""
            };
            break;
        }
        switch (this.codeType) {
          // 实验编号
          case "expNum":
          case "":
            this.basicData.model.expNum = {
              start: this.codeList.start,
              end: this.codeList.end
            };
            this.basicData.model.bloodNum = {
              start: "",
              end: ""
            };
            this.basicData.model.barCodes = {
              start: "",
              end: ""
            };
            this.basicData.model.freeNum = {
              start: "",
              end: ""
            };
            break;
          // 采血编号
          case "bloodnum":
            this.basicData.model.barCodes = {
              start: this.codeList.start,
              end: this.codeList.end
            };
            this.basicData.model.bloodNum = {
              start: "",
              end: ""
            };
            this.basicData.model.expNum = {
              start: "",
              end: ""
            };
            this.basicData.model.freeNum = {
              start: "",
              end: ""
            };
            break;
          // 条形码号
          case "barcode":
            this.basicData.model.barCodes = {
              start: this.codeList.start,
              end: this.codeList.end
            };
            this.basicData.model.bloodNum = {
              start: "",
              end: ""
            };
            this.basicData.model.expNum = {
              start: "",
              end: ""
            };
            this.basicData.model.freeNum = {
              start: "",
              end: ""
            };
            break;
          // 免费券号
          case "freenum":
            this.basicData.model.freeNum = {
              start: this.codeList.start,
              end: this.codeList.end
            };
            this.basicData.model.bloodNum = {
              start: "",
              end: ""
            };
            this.basicData.model.expNum = {
              start: "",
              end: ""
            };
            this.basicData.model.barCodes = {
              start: "",
              end: ""
            };
            break;
        }
        this.getList(this.basicData);
      } else if (type == "reset") {
        this.$refs["basicForm"].resetFields();
        this.timeType = "";
        this.codeType = "";
        this.timeList = [];
        this.codeList = [];
        this.basicData.model = {
          areaId: {
            key: ""
          },
          barCode: "",
          barCodes: {
            end: "",
            start: ""
          },
          birthTime: {
            end: "",
            start: ""
          },
          bloodNum: {
            end: "",
            start: ""
          },
          bloodProperty: {
            data: "",
            key: ""
          },
          bloodTime: {
            end: "",
            start: ""
          },
          createTime: {
            end: "",
            start: ""
          },
          departId: {
            key: ""
          },
          expNum: {
            end: "",
            start: ""
          },
          experimentCode: {
            data: "",
            key: ""
          },
          experimentResult: {
            data: "",
            key: ""
          },
          experimentTime: {
            end: "",
            start: ""
          },
          freeNum: {
            end: "",
            start: ""
          },
          hospitalId: {
            key: ""
          },
          informStatus: {
            data: "",
            key: ""
          },
          momName: "",
          phone: "",
          recallStatus: {
            data: "",
            key: ""
          },
          reportTime: {
            end: "",
            start: ""
          },
          sendStatus: {
            data: "",
            key: ""
          }
        };
        this.getList(this.basicData);
      } else if (type == "infoSave") {
        let data = {
          experimentCode: this.informData.experimentProject,
          fileStatus: this.informData.sampleBlood.fileStatus,
          informContent: this.informData.sampleBlood.informContent,
          informDesc: this.informData.sampleBlood.informDesc,
          informGet: this.informData.sampleBlood.informGet,
          informWay: this.informData.sampleBlood.informWay,
          informMan: this.$store.state.account.user.name,
          informTime: this.informData.sampleBlood.informTime,
          sampleId: this.informData.sampleBlood.id
        };
        RecallManageApi.recheckManage
          .saveInform(data)
          .then(res => {
            if (res.status == 200) {
              this.$message({
                message: res.statusText,
                type: "success"
              });
              this.getList(this.basicData);
            } else {
              this.$message.error(res.statusText);
            }
          })
          .finally(() => (this.informShow = false));
      } else if (type == "statusSave") {
        RecallManageApi.recheckManage
          .saveRecall(this.statuslist)
          .then(res => {
            if (res.status == 200) {
              this.$message({
                message: res.statusText,
                type: "success"
              });
              this.getList(this.basicData);
            } else {
              this.$message.error(res.statusText);
            }
          })
          .finally(() => (this.statusShow = false));
      }
    },
    // 获取基础查询
    initOrgTree() {
      orgApi.allTree({}).then(response => {
        const res = response.data;
        this.orgTree = res.data[0].children;
      });
    },
    // 根据选择市县获取医院
    clickOrgTree(v) {
      this.orgTreeC = [];
      this.orgTreeCs = [];
      this.basicData.model.hospitalId.key = "";
      this.basicData.model.departId.key = "";
      this.orgTree.filter(res => {
        if (res.id == v) {
          this.orgTreeC = res.children;
        }
      });
    },
    // 根据选择市县获取医院
    clickOrgTreeC(v) {
      this.orgTreeCs = [];
      this.basicData.model.departId.key = "";
      this.orgTreeC.filter(res => {
        if (res.id == v) {
          this.orgTreeCs = res.children;
        }
      });
    },
    //点击全选
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    // 点击分页
    handleSizeChange: function(val) {
      this.basicData.size = val;
      this.getList(this.basicData);
    },
    // 选择页码
    handleCurrentChange: function(currentPage) {
      this.basicData.current = currentPage;
      this.getList(this.basicData);
    }
  },
  watch: {
    "recheckData.birthTime": function(v) {
      this.changeBirthTime(v);
    },
    "recheckData.bloodTime": function(v) {
      this.changeBloodTime(v);
    },
    "informData.sampleBlood.informTime": function(v) {
      this.changeInformTime(v);
    }
  }
};
</script>

<style lang="less">
.flex {
  display: flex;
  align-items: center;
  justify-content: center;
}

#recheckmanage {
  .el-range-separator {
    width: 10%;
  }
  .el-form-item__content {
    width: 100%;
    .el-select,
    .el-input,
    .el-date-editor {
      width: 100%;
    }
  }
  .el-table__body-wrapper {
    max-height: 250px;
    overflow-y: auto;
  }
  .inform-print {
    .el-form-item__content {
      width: 90%;
    }
  }
  .resample-form {
    .el-form-item__content {
      width: 100%;
    }
    .el-input {
      width: 100%;
    }
    .el-select {
      width: 100%;
    }
  }
  .sun-table {
    .el-table__body-wrapper {
      max-height: 300px;
      overflow-y: auto;
    }
  }
  .mores {
    .flex;
    justify-content: flex-start;
    width: 100%;
    background: #188ff233;
    height: 30px;
    padding: 5px 8px;
    .more-title {
      font-family: SourceHanSansSC;
      font-style: normal;
      letter-spacing: 0px;
      line-height: 20px;
      text-decoration: none;
      margin-right: 1rem;
      font-size: 14px;
      font-weight: 500;
      color: #000;
    }
  }

  #more-row {
    #shiyan {
      .projectIdList {
        width: 100%;
        .el-form-item__content {
          width: 80%;
        }
      }
    }
    .more-col {
      .remark {
        width: 100%;
        .el-form-item__content {
          width: 90%;
        }
      }
    }
    .el-form-item {
      .el-form-item__content {
        width: 400px;
      }
    }
  }
  .buttom {
    width: 100%;
    .flex;
  }
  .el-dialog__header {
    border-bottom: 1px solid #e0e0e0;
  }
  .print-form {
    max-height: 500px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    flex-flow: wrap;
    .print-item {
      width: 50%;
      .flex;
      justify-content: flex-start;
      color: #222222;
      font-size: 15px;
      margin-top: 10px;
      .title {
        font-weight: bold;
        flex: 0.4;
      }
      .value {
        flex: 0.6;
        font-weight: bold;
        overflow-wrap: anywhere;
      }
    }
  }
  .el-dialog__footer {
    .flex;
  }
  .select-input {
    .el-form-item {
      margin: 0;
      .el-select .el-input {
        width: 100%;
      }
    }
    .flex;
    justify-content: flex-start;
    margin-bottom: 18px;
    .el-select .el-input {
      width: 110px;
    }
    .input-with-select .el-input-group__prepend {
      background-color: #fff;
    }
  }
}
</style>
